package com.example.fragmentbestpracticebyme;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class NewsContentFragment extends Fragment {

    private View view;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
         view = inflater.inflate(R.layout.news_content_fragment,container,false);
        return view;
    }


    public void reFresh(String title,String content){
        TextView textView = view.findViewById(R.id.news_content_title);
        TextView contentTextView = view.findViewById(R.id.news_content_content);
        textView.setText(title);
        contentTextView.setText(content);
    }





}
